﻿<%@ Page MasterPageFile="~/_catalogs/masterpage/Print.master" %>
<%@ Import Namespace="Microsoft.SharePoint.ApplicationPages" %>
<%@ Register TagPrefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls"
    Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register TagPrefix="Utilities" Namespace="Microsoft.SharePoint.Utilities" Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register TagPrefix="asp" Namespace="System.Web.UI" Assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" %>
<%@ Import Namespace="Microsoft.SharePoint" %>
<%@ Assembly Name="Microsoft.Web.CommandUI, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>

<asp:Content ID="PageHead" ContentPlaceHolderID="PlaceHolderAdditionalPageHead" runat="server">
   <script language="javascript" type="text/javascript">
               
        _spBodyOnLoadFunctionNames.push("Initialize");       
        
        var context;
        var site;
        var list;
        var view;
        var htmlView;
        
        function Initialize()
        {
            //var queryString = window.location.search.substring(1);
            //var args = queryString.split('&');
            //var listid = args[0].split('=')[1];
            //var viewid = args[0].split('=')[1];
            
            context = SP.ClientContext.get_current();
            site = context.get_web();
            context.load(site);
            
            //list = site.get_lists().getById(listid);
            //view = list.get_views().getById(viewid);
                        
            //htmlView = view.renderAsHtml();
            
            context.executeQueryAsync(succeeded,failed);
        }
        
        function Sys_Initialize()
        {

        }
        
        function Sys_Load()
        {

        }
        
        function Sys_Dispose()
        {
        }
        
        function succeeded()
        {
            alert("success");
            //$get('mainContent').innerHTML = htmlView.toString();
        }
        
        function failed()
        {
            alert("fail");
            //SP.UI.Status.addStatus("Print list:","Failed to generate print view.");
        }
        
        Sys.Application.add_init(Sys_Initialize);
        Sys.Application.add_load(Sys_Load);
        Sys.Application.add_disposing(Sys_Dispose);
    
    </script>

</asp:Content>

<asp:Content ID="PageTitle" ContentPlaceHolderID="PlaceHolderPageTitle" runat="server">
    
</asp:Content>
<asp:Content ID="PageMain" ContentPlaceHolderID="PlaceHolderMain" runat="server">
    <div id="mainContent" align="center" style="width:90%">
    Loading...
    </div>
</asp:Content>
